<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        //每个对象都有一个私有属性（称之为 [[Prototype]]），它指向它的原型对象（prototype）;
        //该 prototype 对象又具有一个自己的 prototype ，层层向上直到一个对象的原型为 null。
        let o={a:1};
        //o.__proto__===Object.prototype;
        //o.__proto__.__proto__===null;
        let a=['yo'];
        //a.__proto__===Array.prototype;
        //a.__proto__.__proto__===Object.prototype;
        //a.__proto__.__proto__.__proto__==null;
        let f=function(){return 1;};function f1(){return 1;};
        //f.__proto__===Function.prototype;
        //f.__proto__.__proto__===Object.prototype
        //f.__proto__.__proto__.__proto__===null
        function Fun(name,age){
            this.name=name;
            this.age=age;
            this.say=function(){
                console.log(this.name+this.age);
            }
        };
        let obj=new Fun('whh',18);

        //
        function A(name){
            this.name=name;
        }
        let objA=new A('whh');


        //首先 创建objA：let objA=new Object();
        //然后 objA.__proto__=A.prototype;
        //最后A.call(a);


        function funn(name,age){
            this.name=name;
            this.age=age;
        }
        let funo=new funn('whh',18);


        funo1=new Object();
        funo1.__proto__=funn.prototype;
        funn.call(funo1,'whh',18);
        
        let arr=new Array(1,2,3);
        
    </script>
</body>
</html>